<%--
 *  File:    TempBussinessareaInfo.jsp
 *  @Author: Kent Zhong
 *  Date:    11/12/2002 16:27
 *
 *  Copyright (C) 2000 - 2003 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.*" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>



<%--  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.TempBussinessareaInfo");  
String contextPath = request.getContextPath();
%>

<%--  variant and initialization --%>
<%
	String strModuleName = "OGM";
  	String strTableName = "v_zyltempbusinessareainfo";
  	
  	//get current userinfo
  	HashMap CurUserInfo = (HashMap)session.getAttribute("userinfo");
	int orgid = ((Integer)CurUserInfo.get("orgid")).intValue();
  	cat.debug("The userinfo is :"+CurUserInfo);
  	cat.info("enter my page");
  
%>

<%--  include files list --%>

<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>


<html>
<head>
<title>ProductBrand</title>
<PageFlow:CheckPageFlow pageName="p_zyltempbusinessareainfo"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/js/FuncLib.js" ></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js" ></script>
<%@ include file="/inc/CatchError.inc" %>
<%@ include file="/inc/SummaryDivision.inc" %>

<script language="JavaScript" >
   function page_summary(actionvalue,orderbyname)
		{
	  	var editform = summaryPrepare(cform,actionvalue,orderbyname);
	  	editform.action = "TempBussinessareaInfo.jsp";
	  	editform.target = "_self";
	  	isRunning = true;
	  	editform.submit();  
		}
		
		
function page_add()
{


  if(!checkForm(document.cform)) return;
  //if(!checkALLElems(document.getElementById("newdetail"))) return;
  cform.actionname.value = "add";
  cform.target = "_self";
  isRunning = true;
  cform.submit();
}

function page_save()
{
 if(!checkALLElems(document.getElementById("olddetail"))) return;
  page_copydesc();
  cform.actionname.value = "save";
  cform.target = "_self";
  isRunning = true;
  cform.submit();
}
function page_delete()
{
  if(isNullChecked(cform.brandcodes)) 
  {
    alert('<%=message.getMessageDesc("PLEASE_SELECT")%>');
    return;
  }
  if(!confirm('<%= message.getMessageDesc("ARE_YOU_SURE_DEL") %>'))
     return;
            
  cform.actionname.value = "delete";
  cform.target = "_self";
  isRunning = true;
  cform.submit();
}




function allcheckselect(){
	var allcheck = cform.allcheck.checked;
	var alldatafile = document.getElementsByName('brandcodes');
	var length = alldatafile.length;
	if(allcheck){
		for(var i = 0 ; i < length;i++){
			alldatafile[i].checked = true;
		}
	}else{
		for(var i = 0 ; i < length;i++){
			alldatafile[i].checked = false;
		}	
	}
}

</script>
</head>
<body>
<form name="cform" method="post" action="<%=contextPath %>/Dispatcher"  target="_self">
    <input type="hidden" name="pagename" value="p_zyltempbusinessareainfo">
    <input type="hidden" name="actionname">
    <input type="hidden" name="pageaction">
    <input type="hidden" name="parentareaid" value="<%=request.getParameter("parentareaid") %>">
    <input type="hidden" name="isview" value="<%=request.getParameter("isview") %>">
<table width="100%" cellspacing="0" border="0" cellpadding="0">
  <tr> 
    <td> 
      <table width="100%" border="0" cellspacing="0">
        <tr> 
          <td class="summary_top" width="10%" colspan="3" ></td>
        </tr>
        <%@ include file="/inc/SummarySearch.inc" %>
      </table>
    </td>
  </tr>
  <tr> 
    <td> 
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
       
          <tr class="deepblue-left"> 
            <td  class="title_center"><input type="checkbox" name="allcheck" class="normalradio" onclick="allcheckselect();"></td>
            <td  class="title_center"><%=label.getLabelName("L_AreaCode")%><span class="red">*</span></td>
          	<td  class="title_center"><%=label.getLabelName("L_AreaName")%> <span class="red">*</span></td>
          	<td  class="title_center"><%= label.getLabelName("L_IsKeynote")  %></td>
          	<td  class="title_center"><%= label.getLabelName("L_AreaType")  %></td>
          	<td  class="title_center"><%= label.getLabelName("L_Actua_Business") %></td>
            <span id="olddetail">
          </tr>
           <%
            Vector prodbrandsummary=(Vector)pageContext.getAttribute("searchresults");
            if(prodbrandsummary==null)
              prodbrandsummary=new Vector();
            int i=1;
            int org =0;;
            String strClassType="none";
          %>
          <logic:iterate id="prodbrandsummaryitem" collection="<%= prodbrandsummary %>" >
          <%
          	HashMap PSMap = (HashMap)pageContext.getAttribute("prodbrandsummaryitem");
            Integer oColIndexLang=new Integer(i);
            if(i%2==0)
              strClassType="td-listrom";
            else
              strClassType="none";
            i++;
          %>
          <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull(strClassType)%>'"  class="<%=JspHelper.filterNull(strClassType)%>"> 
            <td class="title_center"> 
           		<input type="checkbox" name="brandcodes" id="areaid<%=JspHelper.filterNull(i-1)%>" value="<custom:write name="prodbrandsummaryitem" property="areaid"/>" class="normalradio" />
            </td>
            <td>&nbsp;<custom:write name="prodbrandsummaryitem" property="areacode"/></td>
            <td>&nbsp;<custom:write name="prodbrandsummaryitem" property="areaname"/></td>
            <td>&nbsp;<custom:selectdic name="prodbrandsummaryitem" property="isretail" dictType="YesOrNo" valueCriteria="1,2" defaultValue="----" colIndex="<%=new Integer(i-1) %>" disabled="true"/></td>
            <td>&nbsp;<custom:selectdic dictType="ZYLAreaType" name="prodbrandsummaryitem" property="areatype" style="border:0" defaultValue="------" colIndex="<%=new Integer(i-1) %>" disabled="true"/></td>
            <td>&nbsp;<custom:select property="stdareatype" name="prodbrandsummaryitem" optionInnerTextKey="areaname" optionsName="stdaretypeinfo" optionValueKey="stdareatype"   defaultValue="------" defaultValueCost="" disabled="true" style="width:100px" colIndex="<%=new Integer(i-1) %>"/></td>
          </tr>
          </logic:iterate>
          </span>
          <input type="hidden" name="numrows" value="<%=JspHelper.filterNull(prodbrandsummary.size())+1%>">
      </table>
    </td>
  </tr>
</table>
</form>
</body>
</html>


